package cn.tqfeiyang.smartadmin.system.request;

import java.time.LocalDateTime;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.tqfeiyang.smartadmin.commons.validation.*;
import cn.tqfeiyang.smartadmin.commons.pagination.*;
import jakarta.validation.constraints.*;
import lombok.Data;

/**
 * 操作记录查询请求
 *
 * @author tqfeiyang
 * @since 2024-08-23
 */
@Data
public class OperationLogQueryDTO extends QueryParams {

    /**
     * 用户id
     */
    @Schema(description = "用户id")
    @QueryColumn(logic = QueryLogic.eq)
    private Long userId;

    /**
     * 用户类型
     */
    @Schema(description = "用户类型")
    @QueryColumn(logic = QueryLogic.eq)
    private Integer userType;

    /**
     * 用户名称
     */
    @Schema(description = "用户名称")
    @Size(max = 50, message = "用户名称长度不能超过50字符")
    @QueryColumn(logic = QueryLogic.like)
    private String userName;

    /**
     * 操作模块
     */
    @Schema(description = "操作模块")
    @QueryColumn(logic = QueryLogic.eq)
    private String module;

    /**
     * 操作内容
     */
    @Schema(description = "操作内容")
    @QueryColumn(logic = QueryLogic.eq)
    private String content;

    /**
     * 请求路径
     */
    @Schema(description = "请求路径")
    @QueryColumn(logic = QueryLogic.eq)
    private String url;

    /**
     * 请求方法
     */
    @Schema(description = "请求方法")
    @QueryColumn(logic = QueryLogic.eq)
    private String method;

    /**
     * 请求参数
     */
    @Schema(description = "请求参数")
    @QueryColumn(logic = QueryLogic.eq)
    private String param;

    /**
     * 请求ip
     */
    @Schema(description = "请求ip")
    @QueryColumn(logic = QueryLogic.eq)
    private String ip;

    /**
     * 请求ip地区
     */
    @Schema(description = "请求ip地区")
    @QueryColumn(logic = QueryLogic.eq)
    private String ipRegion;

    /**
     * 请求user-agent
     */
    @Schema(description = "请求user-agent")
    @QueryColumn(logic = QueryLogic.eq)
    private String userAgent;

    /**
     * 请求结果 0失败 1成功
     */
    @Schema(description = "请求结果 0失败 1成功")
    @QueryColumn(logic = QueryLogic.eq)
    private Byte successFlag;

    /**
     * 失败原因
     */
    @Schema(description = "失败原因")
    @QueryColumn(logic = QueryLogic.eq)
    private String failReason;

}